package com.atguigu.gmall.cart.service;

import com.atguigu.gmall.cart.entity.CartInfo;
import com.atguigu.gmall.product.entity.SkuInfo;

import java.util.List;

/**
 * @Description
 * @Return
 * @Author https://weiranyi.github.io
 * @Date Created in 2022-12-16 12:22
 **/
public interface CartService {
    String determinCaryKey();

    SkuInfo addToCart(Long skuId, Integer num, String cartKey);

    List<CartInfo> getCartList(String cartKey);

    // 修改购物车中商品数量
    void updateCartItemNum(Long skuId, Integer num, String cartKey);

    void toggleCartStat(Long skuId, Integer status, String cartKey);

    void deleteItem(Long skuId, String cartKey);

    void delChecked(String caryKey);

    // 获取购物车中选中得商品
    List<CartInfo> getChecked(String cartKey);

    // 删除指定购物车商品
    void deleteSkuIds(String cartKey, List<Long> skuIds);
}
